<template>
	<div>
		城市:{{ city }}
		<div id="city"></div>
	</div>
</template>

<script>
import api from '../api'
export default{
	props:{
		city:{
			type:String,
			default:""
		}
	},
	mounted(){
		let citys=[];
		api.getCity({
			format:"json",
			appid:"12395",
			sign:"83feaadc1daa89cc73988af6f3fb9173"
		}).then(res=>{
			console.log(res.data);
			if(res.status === 200){
				for(var i=0;i<res.data.retdata.length;i++){
					if(res.data.retdata[i].xArea === this.city){
						for(var j=0;j<res.data.retdata[i].subList.length;j++){
							var temp={
								name:res.data.retdata[i].subList[j].city+"市",
								value:res.data.retdata[i].subList[j].curConfirm
							}
							citys.push(temp);
						}
					}
				}	
			}
			this.$charts.provinceMap("city",this.city,citys)
		})
	}
}
</script>

<style scoped>
#city{
	width:100%;
	height:40rem;
	margin:-100px 0 0 0;
}
</style>